﻿using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Xms.Abp.Smsing;

public interface ISmsSender
{
    Task SendAsync(SmsMessage smsMessage);
    Task QueueAsync(SmsMessage smsMessage);
    void ValidateTemplateParameters(IDictionary<string, string> templateParameters, string[] parameterNames);

    public static string[] GetParameters(string value)
    {
        var parameters = value.Split("{{").Skip(1).Select(r => r.Split("}}").First()).ToArray();
        return parameters;
    }
}
